package br.com.dao;

import java.io.Serializable;
import java.util.List;

import br.com.domain.Domain;
import br.com.exception.PersistenceException;


public interface GenericDAO <T extends Domain, ID extends Serializable> {
	
	public T salvar(T t) throws PersistenceException;
	public void salvar(List<T> listEntity) throws PersistenceException;
	public void excluir(T entity) throws PersistenceException;
	public void excluir(List<T> listEntity) throws PersistenceException;
	public Domain buscarPorId(String nomeClasse, Integer Id) throws PersistenceException;
	public List<T> buscarPorFilter(T entity) throws PersistenceException;
	public List<T> buscarTodos(String nomeClasse, String... parametros) throws PersistenceException;
	public List<T> buscarTodos(String nomeClasse, int startPage, int maxPerPage, String... parametros) throws PersistenceException;
	public Boolean executarQueryExecute(String jpql, Object... parametros) throws PersistenceException;
	public T executarQuerySingle(String jpql, Object... parametros) throws PersistenceException;
	public List<T> executarQueryList(String jpql, Object... parametros) throws PersistenceException;
	public T buscarUltimoRegistro(String nomeClasse) throws PersistenceException;
}
